package com.ruoyi.system.controller.trade;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.NewBasicEntity;
import com.ruoyi.system.domain.vo.MaterialUsageVo;
import com.ruoyi.system.domain.vo.PageInfo;
import com.ruoyi.system.service.ITradeMaterialUsageService;
import com.ruoyi.system.utils.MyPageUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.ruoyi.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/trade/material/usage")
@Slf4j
public class TradeMaterialUsageController extends BaseController {

    @Autowired
    private ITradeMaterialUsageService iTradeMaterialUsageService;


    /**
     * 获取所有物资使用情况
     */

    @PreAuthorize("@ss.hasPermi('trade:material:usage:list')")
    @GetMapping("/list")
    public PageInfo<MaterialUsageVo> list(NewBasicEntity newBasicEntity) {
        startPage();
        List<MaterialUsageVo> materialUsageVos = iTradeMaterialUsageService.selectMaterialUsageList();
        log.info("mater",materialUsageVos);
        return MyPageUtils.startPage(materialUsageVos);
    }



}
